package com.sunlands.zlcx.usercenter.client;

import com.sunlands.zlcx.usercenter.config.OauthFeignConfig;
import com.sunlands.zlcx.usercenter.vo.FriendFollowVO;
import com.sunlands.zlcx.usercenter.vo.feign.TzUserBlacklist;
import com.sunlands.zlcx.usercenter.vo.feign.UserFriendInfo;
import com.sunlands.zlcx.usercenter.vo.response.BusinessResult;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author anjl
 */
@SuppressWarnings("unused")
@FeignClient(value = "tz-user-friend", configuration = OauthFeignConfig.class)
public interface UserFriendsService {

    /**
     *
     * @param userId userId
     * @return BusinessResult
     */
    @ApiOperation(value = "道友、关注数量", notes = "道友、关注数量")
    @GetMapping("/user/friendsFollowNumbers")
    BusinessResult<FriendFollowVO> friendsFollowNumbers(@RequestParam(name = "userId") Long userId);

    /**
     *
     * @param userId userId
     * @param friendsUserId friendsUserId
     * @param applyContent applyContent
     * @param friendsType friendsType
     * @return BusinessResult
     */
    @ApiOperation(value = "申请绑定", notes = "申请绑定")
    @GetMapping("/user/applyBindFriends")
    BusinessResult applyBindFriends(@ApiParam(value = "操作者用户id") @RequestParam(name = "userId") Long userId,
                                           @ApiParam(value = "要添加的道友id") @RequestParam(name = "friendsUserId") Long friendsUserId,
                                           @ApiParam(value = "申请绑定的内容") @RequestParam(name = "applyContent")  String applyContent,
                                           @ApiParam(value = "通过邀请码注册，相关的信息",required = false)@RequestParam(name = "inviteContent", required = false) String inviteContent,
                                           @ApiParam(value = "绑定关系，1恋人 2朋友 3同学") @RequestParam(name = "friendsType") Integer friendsType);
    /**
     *
     * @param userId userId
     * @param friendsUserId friendsUserId
     * @param actionType actionType
     * @return BusinessResult
     */
    @ApiOperation(value = "绑定道友", notes = "绑定道友,绑定道友的时候不用传")
    @GetMapping("/user/bindFriends")
    BusinessResult bindFriends(@ApiParam(value = "操作者用户id")@RequestParam(name = "userId")  Long userId,
                               @ApiParam(value = "要添加的道友id")@RequestParam(name = "friendsUserId") Long friendsUserId,
                               @ApiParam(value = "动作类型,1同意 2 拒绝 ，默认值 1 ")@RequestParam(name = "actionType", defaultValue = "1") Integer actionType);


    @ApiOperation(value = "查询道友列表,不分页", notes = "查询道友列表")
    @GetMapping("/user/friendsAll")
    BusinessResult<List<UserFriendInfo>> findFriendsPage(@ApiParam(value = "操作者用户id")@RequestParam(name = "userId")  Long userId);


    @GetMapping("/user/myBlacklist")
    BusinessResult<List<TzUserBlacklist>> myBlacklist(@RequestParam(name = "userId") Long userId);

    @GetMapping("/user/checkBlack")
    BusinessResult<List<TzUserBlacklist>> checkBlack(@RequestParam(name = "userId") Long userId,
                                                      @RequestParam(name = "friendsUserId") Long friendsUserId);

    @GetMapping("/user/checkBlacklist")
    BusinessResult<Integer> checkBlacklist(@ApiParam(value = "用户id",required = true)@RequestParam(value = "userId") Long userId,
                                           @ApiParam(value = "道友id",required = true)@RequestParam(value = "friendsUserId") Long friendsUserId);

    @ApiOperation(value = "关注我的用户", notes = "关注我的用户")
    @GetMapping("/user/follow/me")
    BusinessResult<List<Long>> followMe(@ApiParam(required = true) @RequestParam("userId") Long userId);

    @GetMapping("/user/friendsAll")
    BusinessResult<List<UserFriendInfo>> friendsAll(@RequestParam("userId") Long userId);
}

